﻿Imports System.ComponentModel

Public Class WatchView

    Implements INotifyPropertyChanged

    Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged

    Private _Watch As Watch
    Private _Brand As Brand
    Private _DBContext As DBContext

    Public Sub New()

    End Sub

    Public Sub New(DBContext As DBContext, WatchID As Byte())
        _DBContext = DBContext
        _Watch = _DBContext.getWatchFromID(WatchID)
    End Sub

    Public ReadOnly Property Watch As Watch
        Get
            Return _Watch
        End Get
    End Property

    Public Property Brand As Brand
        Get
            If _Brand Is Nothing AndAlso _Watch IsNot Nothing Then
                _Brand = _DBContext.GetBrandFromID(_Watch.RefBrand)
            End If
            Return _Brand
        End Get
        Set(value As Brand)

        End Set
    End Property


End Class
